package Modal;

public class SaleLineItem {
    ProductDescription product;
    int qty;
    double subTotal;

    public double getSubTotal() {
        return subTotal;
    }

    public SaleLineItem(ProductDescription product, int qty) {
        this.product = product;
        this.qty = qty;
        subTotal = qty * product.getPrice();
    }

    @Override
    public String toString() {
        return product.getName() + '\t' + product.getPrice() + "\t" + qty + '\t' + subTotal;
    }
}